home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / gui / textfield.lha / Textfield / TestClass / TextFieldAuto.c < prev   
Encoding:
C/C++ Source or Header  |  1995-02-15  |  975 b   |  43 lines

  1. /*
  2.  * TextField autoinit and autoterminate functions
  3.  * for SAS/C 6.50 and up.
  4.  *
  5.  * If you just compile and link this into your application
  6.  * then TextFieldBase and TextFieldClass will be
  7.  * automatically initialized before main() is called.
  8.  *
  9.  * Your application will only need to use TextFieldClass
  10.  * when calling NewObject() and include <proto/textfield.h>.
  11.  *
  12.  * This file now uses the new TEXTFIELD_NAME and TEXTFIELD_VER
  13.  * defines from textfield.h.
  14.  */
  15.  
  16. #include <exec/types.h>
  17. #include <intuition/classes.h>
  18. #include <gadgets/textfield.h>
  19.  
  20. #include <proto/exec.h>
  21. #include <proto/textfield.h>
  22.  
  23. struct Library *TextFieldBase;
  24. Class *TextFieldClass;
  25.  
  26. int _STI_200_TextFieldInit(void)
  27. {
  28.     TextFieldBase = OpenLibrary(TEXTFIELD_NAME, TEXTFIELD_VER);
  29.     if (TextFieldBase) {
  30.         TextFieldClass = TEXTFIELD_GetClass();
  31.         return 0;
  32.     } else {
  33.         return 1;
  34.     }
  35. }
  36.  
  37. void _STD_200_TextFieldTerm(void)
  38. {
  39.     CloseLibrary(TextFieldBase);
  40.     TextFieldClass = NULL;
  41.     TextFieldBase = NULL;
  42. }
  43.